import request from "@/utils/request";

// 能力排名
export function abilityRank(type, params) {
  return request({
    url: `/${type}/dataCenter/abilityRank`,
    method: "get",
    params: params,
  });
}
// 课程学习进度卡片
export function courseCard(type, params) {
  return request({
    url: `/${type}/dataCenter/courseCard`,
    method: "get",
    params: params,
  });
}
// 课程数据
export function courseDatalist(type, params) {
  return request({
    url: `/${type}/dataCenter/courseDatalist`,
    method: "get",
    params: params,
  });
}
export const courseDatalistHeader = [
  {
    name: "序号",
    width: 70,
    key: "index",
    index: true,
  },
  {
    name: "课程",
    width: 250,
    key: "course_name",
  },
  {
    name: "关联工作站",
    width: 200,
    key: "workstationNames",
  },
  {
    name: "已报名人数",
    width: 145,
    key: "signUpNum",
    sortable: true,
  },
  {
    name: "在学人数",
    width: 130,
    key: "studyNum",
    sortable: true,
  },
  {
    name: "平均成绩(历史)",
    width: 180,
    key: "avgScorePercent",
    sortable: true,
  },
  {
    name: "平均成绩(本学期)",
    width: 200,
    key: "avgScorePercent",
    sortable: true,
  },
  {
    name: "平均完成时间(h)",
    width: 190,
    key: "index",
    sortable: true,
  },
  {
    name: "评价",
    width: 200,
    key: "index",
    sortable: true,
    appraise: true,
  },
  {
    name: "及格率",
    width: 110,
    key: "hAvgScorePercent",
    sortable: true,
    percentage: true,
  },
];
// 重修情况
export function reStartCourseData(type, params) {
  return request({
    url: `/${type}/dataCenter/reStartCourseData`,
    method: "get",
    params: params,
  });
}
export const reStartCourseDataHeader = [
  {
    name: "序号",
    width: 100,
    key: "index",
    index: true,
  },
  {
    name: "学生",
    width: 400,
    classmix: ["name", "user_name"],
  },
  {
    name: "专业(班级)",
    width: 400,
    classmix: ["major_name", "class_name"],
  },
  {
    name: "课程",
    width: 400,
    key: "course_name",
  },
  {
    name: "重修次数",
    width: 400,
    key: "restartNum",
    sortable: true,
  },
];
// 学生数据
export function studentDatalist(type, params) {
  return request({
    url: `/${type}/dataCenter/studentDatalist`,
    method: "get",
    params: params,
  });
}
export const studentDatalistHeader = [
  {
    name: "序号",
    width: 60,
    key: "index",
    index: true,
  },
  {
    name: "学生",
    width: 250,
    key: "name",
  },
  {
    name: "专业(班级)",
    width: 250,
    classmix: ["major_name", "class_name"],
  },
  {
    name: "平均成绩(本学期/历史)",
    width: 250,
    key: "avgScore",
    mix: ["avgScore", "avgTotalScore"],
    sortable: true,
  },
  {
    name: "必修学分",
    width: 190,
    key: "compulsory_credit",
    mix: ["compulsory_credit", "needCompulsoryCredit"],
    sortable: true,
  },
  {
    name: "选修学分",
    width: 190,
    key: "optional_credit",
    mix: ["optional_credit", "needOptionalCredit"],
    sortable: true,
  },
  {
    name: "工学学分",
    width: 190,
    key: "engineering_credit",
    mix: ["engineering_credit", "needEngineeringCredit"],
    sortable: true,
  },
  {
    name: "考证学分",
    width: 190,
    key: "research_credit",
    mix: ["research_credit", "needCompetitionCredit"],
    sortable: true,
  },
  {
    name: "活跃度",
    width: 110,
    key: "hAvgScorePercent",
    sortable: true,
  },
];
// 学习预警
export function studyWarn(type, params) {
  return request({
    url: `/${type}/dataCenter/studyWarn`,
    method: "get",
    params: params,
  });
}
export const studyWarnHeader = [
  {
    name: "序号",
    width: 100,
    key: "index",
    index: true,
  },
  {
    name: "学生",
    width: 250,
    classmix: ["name", "user_name"],
  },
  {
    name: "专业(班级)",
    width: 300,
    classmix: ["major_name", "class_name"],
  },
  {
    name: "课程",
    width: 250,
    key: "course_name",
  },
  {
    name: "班级进度",
    width: 200,
    key: "avgClassProgress",
    sortable: true,
  },
  {
    name: "该生进度",
    width: 200,
    key: "learning_progress",
    sortable: true,
  },
  {
    name: "进度差",
    width: 200,
    key: "difference",
    percentage: true,
    sortable: true,
  },
  {
    name: "预警时间",
    width: 200,
    key: "time",
    sortable: true,
  },
];
// 教师数据
export function teacherDatalist(type, params) {
  return request({
    url: `/${type}/dataCenter/teacherDatalist`,
    method: "get",
    params: params,
  });
}
export const teacherDatalistHeader = [
  {
    name: "序号",
    width: 60,
    key: "index",
    index: true,
  },
  {
    name: "教师",
    width: 250,
    key: "name",
  },
  {
    name: "主讲课程数量",
    width: 170,
    key: "num",
    sortable: true,
  },
  {
    name: "负责工作站数量",
    width: 190,
    key: "workstationNum",
    sortable: true,
  },
  {
    name: "批改试卷数量(本学期/历史)",
    width: 180,
    key: "allExamMarkNum",
    mix: ["exam_mark_num", "allExamMarkNum"],
  },
  {
    name: "申请处理数量(本学期/历史)",
    width: 180,
    key: "allApplyNum",
    mix: ["apply_num", "allApplyNum"],
  },
  {
    name: "学生平均分(百分制)",
    width: 220,
    key: "avgScorePercent",
    sortable: true,
  },
  {
    name: "学生及格率",
    width: 150,
    key: "index",
    percentage: true,
    sortable: true,
  },
  {
    name: "评价",
    width: 200,
    key: "index",
    sortable: true,
    appraise: true,
  },
  {
    name: "活跃度",
    width: 110,
    key: "hAvgScorePercent",
    sortable: true,
  },
];
// 工作站数据
export function workstationDatalist(type, params) {
  return request({
    url: `/${type}/dataCenter/workstationDatalist`,
    method: "get",
    params: params,
  });
}
export const workstationDatalistHeader = [
  {
    name: "序号",
    width: 100,
    key: "index",
    index: true,
  },
  {
    name: "工作站",
    width: 400,
    classmix: ["workstation_name", "workstation_num"],
  },
  {
    name: "工作站地址",
    width: 400,
    key: "workstation_address",
  },
  {
    name: "负责人",
    width: 200,
    key: "name",
  },
  {
    name: "课程关联数",
    width: 200,
    key: "connectNum",
    sortable: true,
  },
  {
    name: "课程学生数",
    width: 200,
    key: "workstationStudyNum",
    sortable: true,
  },
  {
    name: "评价",
    width: 200,
    key: "appraise",
    sortable: true,
    appraise: true,
  },
];
